home *** CD-ROM | disk | FTP | other *** search
/ Loadstar 128 24 / q24.d81 / t.mouse 80 < prev    next >
Text File  |  2022-08-28  |  18KB  |  333 lines

  1.  
  2.  
  3.                              M O U S E    8 0
  4.  
  5.                             by Maurice Randall
  6.  
  7.  
  8. FENDER'S PREMUMBLE: The following is essentially the same instructions for
  9. using MOUSE 80 that were published on LS 128 #15.  I've removed the part
  10. about the "mousemover" program which allowed you to assemble the MOUSE 80
  11. object code where you want.  If you don't want to use any of the three
  12. versions of the object code that appear on this issue, then you'll need LS
  13. 128 #10 to make your own version.  If you do use MouseMover from LS 128
  14. #15 then here's a tip: After creating a version of MOUSE 80 at a location,
  15. break out of the MouseMover program and re-run it.  If you assemble
  16. another version of MOUSE 80 without breaking out and re-running the
  17. program, the second (and any subsequent) version won't work properly.
  18.  
  19.  
  20.      MOUSE 80 is a device driver for the Commodore 1351 mouse or
  21. compatibles.  It is designed to be used with the 128 in 80 column 'text
  22. mode' only.  This driver will fill a void that most people do not realize
  23. existed.  The 1351 mouse has been around for a while now, and there are
  24. mouse drivers for it.  The demo disk that comes with the mouse has an
  25. assortment of drivers for the 64 mode and the 128 mode, but the 128 mode
  26. driver is only for 40-column use.  It makes use of a sprite for the
  27. pointer that is visible on the screen.  Sprites are not available on the
  28. 80-column screen.  Sprites are easily simulated on the 128's 80-column
  29. graphic screen, but then you are limited to creating 'graphic text'.  GEOS
  30. works this way, and GEOS is an excellent system, but there is still a need
  31. for applications written to use the 128's native text mode.
  32.  
  33.      What makes this driver different is the fact that it moves the
  34. pointer about the text screen smoothly.  There have been other mouse
  35. drivers for the 80-column text screen, but these move the mouse pointer
  36. around the screen a full character at a time.  They work fine, but the
  37. smoothness of movement isn't there.  The only smooth mouse pointer I'm
  38. aware of for the 128 is incorporated into the Pocket Series software from
  39. Digital Solutions.  But their mouse routines are not available to the
  40. public.  Therefore, I have designed MOUSE 80 so that other software
  41. developers might make use of the 1351 mouse with a smooth moving pointer
  42. in their programs.  Any new development for the 128 should definitely make
  43. use of the new hardware that is available, and MOUSE 80 will help give a
  44. more professional appearance to the program.
  45.  
  46.      MOUSE 80 can be used with a BASIC or ML program.  It uses a jump
  47. table to call its routines and you can also read or change various
  48. variables that are used by MOUSE 80.
  49.  
  50.      To use MOUSE 80, you would include the following statement in a BASIC
  51. loader:
  52.  
  53.  bload"mouse80.o"onu(dv)      where dv is the current drive number
  54.  
  55.      Once your main program begins, you can use the various jump addresses
  56. and variables locations to initially install the mouse wedge into the IRQ
  57. interrupt sequence, turn the mouse pointer on and off, or to find or set
  58. the pointer on the screen.  You can locate the pointer according to its
  59. pixel location.  You can also confine the mouse to a defined region or
  60. 'window'.  You can tell if either button is being pressed.  You can also
  61. instruct MOUSE 80 to set up a jump address for the application to call if
  62. one of the buttons is pressed.
  63.  
  64.      If you don't like the looks of the mouse pointer, you can change its
  65. appearance by altering the eight bytes that make up its picture.
  66.  
  67.      There are four graphic characters from the upper/lower case set that
  68. are used by MOUSE 80.  If you need to use these characters, you can choose
  69. any other four characters instead.  It would be a very rare program that
  70. would have to use each of the 512 characters that are available.
  71.  
  72.      Whenever you are accessing the screen, you should 'hide' the mouse
  73. pointer to prevent garbage from appearing on the screen.  The 80-column
  74. VDC chip is very touchy, and does not like the mouse when the screen is
  75. scrolling, or if you are typing characters into the same location that the
  76. mouse is occupying.  So, just call 'HIDEMOUS' before any screen access and
  77. call 'SHOWMOUS' when finished.  When the mouse is hidden, the pointer is
  78. not displayed, but movement is still possible.  So, you could use this to
  79. your advantage for various things such as menus.  As the mouse is moved up
  80. and down, you could highlight the menu item that is being pointed at, much
  81. like what is usually done with the CRSR keys.  If you call the routine,
  82. 'STOPMOUS', then the pointer is not only hidden, but its location also is
  83. not updated.  It will remain frozen in the spot it was in when the routine
  84. was called.  The buttons are still active so that you can still check for
  85. either button being pressed.  Either 'SHOWMOUS' or 'HIDEMOUS' will then
  86. make the mouse active again.  'HIDEMOUS' will leave the pointer hidden.
  87.  
  88.      The following is a list of available routines and variables along
  89. with their locations in memory:
  90.  
  91.  Name       ML           Basic       Description
  92.  -------------------------------------------------------------------------
  93.  
  94.  INSTALL   JSR $1300    SYS 4864    Initially installs the mouse wedge
  95.  REMOVE    JSR $1303    SYS 4867    Removes mouse wedge from thesystem.
  96.  HIDEMOUS  JSR $1306    SYS 4870    Hides the pointer from view.
  97.  SHOWMOUS  JSR $1309    SYS 4873    Displays the pointer on the screen.
  98.  STOPMOUS  JSR $130C    SYS 4876    Stops the mouse and hides it.
  99.  CKSTATUS  JSR $130F    SYS 4879    Check location of mouse on screen.
  100.  USERJUMP  JSR $1312    SYS 4882    User callable according to buttons.
  101.  
  102. (Locations $1315-$1317 are not used.  They are reserved for future use.)
  103.  
  104.      There are a number of variables that may be read or set.  Here is a
  105. listing of those variables, their location offset in relation to the
  106. starting address and a brief description.
  107.  
  108. The following bytes define the region in which to confine the mouse
  109. pointer. The default settings are for the entire screen.
  110.  
  111.  LTXLIMIT         +24,25         Left border (lsb,msb) (0-319)
  112.  UPYLIMIT         +26            Upper border (0-199)
  113.  RTXLIMIT         +27,28         Right border (lsb,msb) (0-319)
  114.  LOYLIMIT         +29            Lower border (0-199)
  115.  
  116. The following locations define the present location of the mouse.  These
  117. are best checked by machine language.  When using BASIC, the mouse could
  118. move between the time it takes to check the X position and the Y
  119. position.
  120.  
  121.  XCHAR            +30            Column location of the mouse.
  122.  YCHAR            +31            Row location of the mouse.
  123.  CXPOS            +32,33         Horizontal pixel location of the mouse.
  124.  CYPOS            +34            Vertical pixel location of the mouse
  125.  
  126. From BASIC, (or ML) you could check these locations after accessing the
  127. routine called 'CKSTATUS' at $130F with a SYS 4879.  The exact location of
  128. the mouse when 'CKSTATUS' is accessed is saved here until the next time
  129. the routine is accessed.
  130.  
  131.  BXCHAR           +35            Column location.
  132.  BYCHAR           +36            Row location.
  133.  BCXPOS           +37,38         Horizontal pixel location.
  134.  BCYPOS           +39            Vertical pixel location.
  135.  
  136. These next two locations may be set in order to place the mouse pointer at
  137. a specific location on the screen.  'SETXPOS' should be set to a two-byte
  138. value ranging from 0-319, and 'SETYPOS' should be 0-199.  Always POKE the
  139. value into SETXPOS+1 last, because after MOUSE 80 checks these bytes, bit
  140. 7 of SETXPOS+1 will be set which makes MOUSE 80 ignore these values.  If
  141. you were to set this location before the other three (from BASIC), they
  142. would most likely be read before you are done setting the other bytes and
  143. so the mouse would not be placed in the desired location.  From machine
  144. language, it is not a problem since you can disable the interrupts first.
  145.  
  146.  SETXPOS          +40,41         Place pointer at this X location.
  147.  SETYPOS          +42            Place pointer at this Y location.
  148.  LTBUTTON         +43            Current status of left button.
  149.  RTBUTTON         +44            Current status of right button.
  150.  LTCHECK          +45            Latched status of left button.
  151.  RTCHECK